(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.transaction.history.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'transactionService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, transactionService) {
		var ctrl = this, txnHistoryInfo = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		ctrl.txnHistory = {};
		ctrl.init = function() {
			var params = {
					txnHistoryId : txnHistoryInfo.txnHistoryId
			};
			return authService.view(params).then(function(response) {
				transactionService.dataFilter().then(function(result){
					ctrl.transactionStatusFilter = result.transactionStatusFilter;
					ctrl.transactionActionFilter = result.transactionActionFilter;
					ctrl.transactionPayFilter = result.transactionPayFilter;
					ctrl.txnHistory = response.data || txnHistoryInfo;
					ctrl.txnHistory.txnHistoryId=txnHistoryInfo.txnHistoryId;
				});
			}, angular.noop);
		};
	}
})(angular);